package psnl.bingo.mr.demo2;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

// Mapper输出数据的分组器
public class D2MapOutGroup extends WritableComparator {
    public D2MapOutGroup() {
        super(D2Line.class, true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        D2Line aa = (D2Line) a;
        D2Line bb = (D2Line) b;
        return aa.groupKey().compareTo(bb.groupKey());
    }
}
